home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Examples / Cards / Cards.r next >
Encoding:
Text File  |  1990-10-25  |  5.2 KB  |  229 lines  |  [TEXT/MPS ]

  1. /* Copyright © 1986-1990 by Apple Computer, Inc.  All rights reserved. */
  2.  
  3. /* • Auto-Include the requirements for this source */
  4. #ifndef __TYPES.R__
  5. #include "Types.r"
  6. #endif
  7.  
  8. #ifndef __MacAppTypes__
  9. #include "MacAppTypes.r"
  10. #endif
  11.  
  12. #if qTemplateViews
  13. #ifndef __ViewTypes__
  14. #include "ViewTypes.r"
  15. #endif
  16. #endif
  17.  
  18. #if qDebug
  19. include "Debug.rsrc";
  20. #endif
  21. include "MacApp.rsrc";
  22. include "Printing.rsrc";
  23.  
  24. include $$Shell("ObjApp")"Cards" 'CODE';
  25.  
  26.  
  27. #define kWindowRsrcID        1000    /* ID of the main window or view resource */
  28. #define kCardViewRsrcID        1001    /* ID of the card view resource */
  29. #define kAboutDoc            1201    /* ID of the About box showing document info */
  30.  
  31. #define kIDAppBuzz            1000    /* Our buzz string resource */
  32.  
  33. /* Our command numbers */
  34. #define cNextCard            1000    /* Next Card command */
  35. #define cPrevCard            1001    /* Previous Card command */
  36. #define cFirstCard            1002    /* First Card command */
  37. #define cLastCard            1003    /* Last Card command */
  38. #define cNewCard            1010    /* New Card command */
  39. #define cDeleteCard         1011    /* Delete Card command */
  40.  
  41.  
  42. resource 'STR#' (kIDAppBuzz, purgeable) {
  43.     {
  44.         /*  1 */ "This document contains no cards."
  45.     }
  46. };
  47.  
  48.  
  49. resource 'view' (kWindowRsrcID, purgeable) { {
  50.     root, 'WIND', { 50, 20 }, { 150, 470 },
  51.     sizeVariable, sizeVariable, shown, enabled,
  52.     Window {
  53.         "TWindow",
  54.             zoomDocProc, goAwayBox, resizable, modeless, ignoreFirstClick, freeOnClosing,
  55.             disposeOnFree, closesDocument, openWithDocument, dontAdaptToScreen, stagger,
  56.             forceOnScreen, dontCenter, noID, "" };
  57.  
  58.     'WIND', 'SCLR',    { 0, 0 }, { 150 - kSBarSizeMinus1, 470 - kSBarSizeMinus1 },
  59.     sizeRelSuperView, sizeRelSuperView, shown, enabled,
  60.     Scroller {
  61.         "TScroller",
  62.             vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  63.             vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  64.  
  65.     'SCLR', 'EMPT', { 0, 0 }, { 150 - kSBarSizeMinus1, 470 - kSBarSizeMinus1 },
  66.     sizeSuperView, sizeSuperView, shown, enabled,
  67.     View { "TEmptyView" }
  68. } };
  69.  
  70.  
  71. resource 'view' (kCardViewRsrcID, purgeable) {{
  72.     root, 'CARD', { 0, 0 }, { 116, 1020 },
  73.     sizeVariable, sizePage, shown, enabled,
  74.     TEView {
  75.         "TCardView",
  76.             withoutStyle, autoWrap, acceptChanges, dontFreeText, cTyping, unlimited,
  77.             { 8, 10, 0, 10 }, justSystem, applFont12 }
  78. } };
  79.  
  80.  
  81. resource 'SIZE' (-1) {
  82.     saveScreen,
  83.     acceptSuspendResumeEvents,
  84.     enableOptionSwitch,
  85.     canBackground,
  86.     MultiFinderAware,
  87.     backgroundAndForeground,
  88.     dontGetFrontClicks,
  89.     ignoreChildDiedEvents,
  90.     is32BitCompatible,
  91.     reserved,
  92.     reserved,
  93.     reserved,
  94.     reserved,
  95.     reserved,
  96.     reserved,
  97.     reserved,
  98. #if qDebug
  99.     500 * 1024,
  100.     400 * 1024
  101. #else
  102.     300 * 1024,
  103.     200 * 1024
  104. #endif
  105. };
  106.  
  107. resource 'seg!' (256, purgeable) {
  108.     {
  109.         "GTerminate";
  110.         "GNonRes";
  111.         "GWriteFile";
  112.         "GFile";
  113.         "GClose";
  114.         "GDoCommand";
  115.         "GClipboard";
  116.         "GSelCommand"
  117.     }
  118. };
  119.  
  120.  
  121. /*--------------------------------------*/
  122. /*            About boxes                    */
  123. /*--------------------------------------*/
  124.  
  125. resource 'DITL' (phAboutApp, purgeable) {
  126.      {    /* array DITLarray: 3 elements */
  127.         /* [1] */
  128.         {160, 182, 180, 262},
  129.         Button {
  130.             enabled,
  131.             "OK"
  132.         };
  133.         /* [2] */
  134.         {10, 75, 150, 316},
  135.         StaticText {
  136.             disabled,
  137.             "This sample program illustrates the use of disk-based documents. "
  138.             "\n\nThis program was written "
  139.             "with MacApp® © 1985-1990 Apple Computer, Inc."
  140.         };
  141.         /* [3] */
  142.         {10, 20, 42, 52},
  143.         Icon {
  144.             disabled,
  145.             1
  146.         }
  147.     }
  148. };
  149.  
  150. include "Defaults.rsrc"  'ALRT' (phAboutApp);    // Grab the default about box
  151.  
  152. resource 'DITL' (kAboutDoc, purgeable) {
  153.      {    /* array DITLarray: 3 elements */
  154.         /* [1] */
  155.         {80, 182, 100, 262},
  156.         Button {
  157.             enabled,
  158.             "OK"
  159.         };
  160.         /* [2] */
  161.         {10, 75, 70, 310},
  162.         StaticText {
  163.             disabled,
  164.             "The current document is ^0. "
  165.             "It has ^1 card^2 and occupies ^3 bytes on disk."
  166.         };
  167.         /* [3] */
  168.         {10, 20, 42, 52},
  169.         Icon {
  170.             disabled,
  171.             1
  172.         }
  173.     }
  174. };
  175.  
  176. resource 'ALRT' (kAboutDoc, purgeable) {
  177.     {90, 100, 200, 412},
  178.     kAboutDoc,
  179.     {
  180.         OK, visible, silent;
  181.         OK, visible, silent;
  182.         OK, visible, silent;
  183.         OK, visible, silent
  184.     }
  185. };
  186.  
  187. /*--------------------------------------*/
  188. /*                Menus                    */
  189. /*--------------------------------------*/
  190.  
  191. include "Defaults.rsrc" 'cmnu' (mApple);        // Grab the default Apple/File menus
  192. include "Defaults.rsrc" 'cmnu' (mFile);
  193. include "Defaults.rsrc" 'cmnu' (mEdit);
  194. include "Defaults.rsrc" 'cmnu' (mBuzzwords);    // Get the default buzzwords
  195.  
  196. resource 'cmnu' (4) {
  197.     4,
  198.     textMenuProc,
  199.     0x7FFFFF80,
  200.     enabled,
  201.     "Cards",
  202.     {    /* array: 7 elements */
  203. /* [1] */    "Next Card",        noIcon, "F",    noMark, plain, cNextCard;
  204. /* [2] */    "Previous Card",    noIcon, "B",    noMark, plain, cPrevCard;
  205. /* [3] */    "First Card",        noIcon, "1",    noMark, plain, cFirstCard;
  206. /* [4] */    "Last Card",        noIcon, "2",    noMark, plain, cLastCard;
  207. /* [5] */    "-",                noIcon, noKey,    noMark,    plain, nocommand;
  208. /* [6] */    "Add Card",            noIcon, "M",    noMark, plain, cNewCard;
  209. /* [7] */    "Delete Card",        noIcon, noKey,    noMark, plain, cDeleteCard
  210.     }
  211. };
  212.  
  213. resource 'MBAR' (kMBarDisplayed) {
  214.     {mApple; mFile; mEdit; 4}
  215. };
  216.  
  217.  
  218. include "Defaults.rsrc"  'STR#' (kDefaultCredits);        // Grab the default credits
  219.  
  220. // Get the default MacApp® application icon and necessary bundling rsrcs
  221. include "Defaults.rsrc"  'MApp' (0);
  222. include "Defaults.rsrc"  'FREF' (128);
  223. include "Defaults.rsrc"  'BNDL' (128);
  224. include "Defaults.rsrc"  'ICN#' (128);
  225.  
  226. // Get the default Version resources
  227. include "Defaults.rsrc"  'vers' (1);        // Application or file specific
  228. include "Defaults.rsrc"  'vers' (2);        // Overall package
  229.